CREATEPROCEDURE[dbo].[BAECompanyContactLoginValidation] @UserIDasvarchar(10) AS /* General Notes: Ideally, you would want this procedure to only return one row in order to maximize efficiency. Regardless of how it determines who has access, it absolutely must return the ID field from the iMIS Name table in some fashion. */ SELECTIDFROMNameWHEREMEMBER_TYPEIN('CM')ANDCO_ID<>''ANDID=@UserID;